package com.wtwd.campus.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.campus.entity.Grade;
import com.wtwd.campus.model.vo.GradeVO;
import com.wtwd.campus.model.vo.ResultVO;

import java.util.List;
import java.util.Map;

/**
 * @author mjy
 * @date 2021/06/17
 * @description
 */
public interface GradeService {
    List<Map<String, Object>> getGradeIdAndGradeNameBySchoolId(Integer schoolId);

    /**
     * 分页查询年级
     *
     * @param page
     * @param schoolIds
     * @return
     */
    IPage<GradeVO> queryPage(Page page, List<Integer> schoolIds);

    /**
     * 删除年级通过Id
     *
     * @param id
     * @return
     */
    ResultVO deleteGradeById(Integer id);

    /**
     * 批量创建年级
     *
     * @param grade
     * @param gradeNames 1,2
     * @return
     */
    ResultVO createGradeBatch(Grade grade, String gradeNames);

    /**
     * 获取年级通过学校Ids
     *
     * @param schoolIds
     * @return
     */
    List<Grade> listGradeBySchoolIds(List<Integer> schoolIds);

    /**
     * 根据学校Id,年级名称获取年级
     *
     * @param schoolId
     * @param gradeName
     * @return
     */
    Grade getGradeByGradeNameAndSchoolId(Integer schoolId, String gradeName);

    /**
     * 单个存储年级 返回主键
     * @param grade
     * @return
     */
    Grade save(Grade grade);
}
